<template>
	<yd-layout id='playList' class=''>
		<div class="content">
			<div class="list" @click="goNext(item)" v-for="item in dataList">
				<div class="list_title">{{item.title}}</div>
				<div class="list_note">{{item.note}}</div>
				<img v-if="item.bauth!=1" class="list_img" src="../../assets/playList_1.png" alt="" />
			</div>
		</div>
	</yd-layout>
</template>

<script>
	export default {
		components: {

		},
		data() {
			return {
				dataList: [],
			}
		},
		created() {},
		watch: {

		},
		computed: {

		},
		mounted() {
			document.title = '视频课堂'
			this.getPlayList();
		},
		methods: {

			getPlayList() {
				this.$root.ajax({
					name: 'video/cates',
					type: 'get',
					params: {
						pid: 0
					}
				}).then((d) => {
					this.dataList = d.data
				})
			},
			goNext(item) {
				if(item.bauth == 1) {
					//有权限
					this.$router.push({
						name: 'playListDetail',
						query: {
							id: item.id
						}
					})
				} else {
					//无权限
					this.$dialog.confirm({
						title: '温馨提示',
						mes: '我有一个小毛驴我从来也不骑！',
						opts: [{
							txt: '知道了',
							color: '#DCBBC9',
							callback: () => {

							}
						}, ]
					});
				}
			}
		}
	}
</script>

<style lang="scss">
	@import './playList.scss';
</style>